import React, { PureComponent } from 'react';
import { Form, Row, Col, Cascader, DatePicker, Input, Select } from 'antd';
import moment from 'moment';
import { DEFAULT_RESPONE_SUCCESS, DEFAULT_VALID_STATE } from '@/constants';

const { TextArea } = Input;
const { Option } = Select;

export default class Index extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            areas: []
        }
    }

    componentDidMount() {
    }

    render() {
        const { areas = [] } = this.state;
        const { form, data = {}, disabled = false } = this.props;
        const { getFieldDecorator } = form;

        return (
            <Form layout='vertical'>
                <Form.Item label='标题'>
                    {getFieldDecorator('rememberTitle', {
                        initialValue: data.rememberTitle || undefined,
                        rules: [{ required: true, message: '该项为必填项' }]
                    })(
                        <Input placeholder='请输入事件标题' size='large' disabled={disabled} />
                    )}
                </Form.Item>
                <Form.Item label='记事内容'>
                    {getFieldDecorator('rememberConcat', {
                        initialValue: data.rememberConcat || undefined,
                        rules: [{ required: true, message: '该项为必填项' }]
                    })(
                        <TextArea rows={4} placeholder='请输入事件简述' disabled={disabled} />
                    )}
                </Form.Item>
                <Row gutter={16} type='flex'>
                    <Col span={12}>
                        <Form.Item label='类型'>
                            {getFieldDecorator('rememberType', {
                                initialValue: data.rememberType || undefined,
                                rules: [{ required: true, message: '该项为必填项' }]
                            })(
                                <Select placeholder='请选择类型'>
                                    <Option value="1" key="zbgz">值班工作</Option>
                                    <Option value="2" key="ylyd">舆论应对</Option>
                                    <Option value="3" key="jrgz">舆情选摘</Option>
                                    <Option value="4" key="jrgz">今日关注</Option>
                                </Select>
                            )}
                        </Form.Item>
                    </Col>
                    <Col span={12}>
                        <Form.Item label='来源'>
                            {getFieldDecorator('rememberSource', {
                                initialValue: data.rememberSource || undefined,
                                rules: [{ required: true, message: '该项为必填项' }]
                            })(
                                <Input placeholder='请输入记事来源' disabled={disabled} />
                            )}
                        </Form.Item>
                    </Col>
                </Row>
            </Form>
        );
    }
}
